package com.qk.state.action;

import com.qk.enums.ClueEvent;
import com.qk.enums.ClueState;
import com.qk.service.ClueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.statemachine.StateContext;
import org.springframework.statemachine.action.Action;
import org.springframework.stereotype.Component;

/**
 * @author 28188
 */
@Component
public class ClueToBusinessAction implements Action<ClueState, ClueEvent> {

    @Autowired
    private ClueService clueService;

    @Override
    public void execute(StateContext<ClueState, ClueEvent> context) {
        String clueId = (String) context.getMessageHeader("clueId");
        clueService.convertToBusiness(Integer.valueOf(clueId));
    }
}
